package ylyhappy.cn.ideavim.lg.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

import ylyhappy.cn.ideavim.ui.IdeaVimBuilderApplication;

public class DataLoaderThread extends Thread {
    private final Context context;

    public DataLoaderThread(Context context) {
        this.context = context;
    }

    @Override
    public void run() {

        final String DB_NAME = "ideavim.db";
        final int DB_VERSION = 1;
        final MyDatabaseHelper myDatabaseHelper = new MyDatabaseHelper(context, DB_NAME, DB_VERSION);
        SQLiteDatabase db = myDatabaseHelper.getWritableDatabase();


        IdeaVimBuilderApplication.actions = ActionKt.selectAction(db);
        myDatabaseHelper.close();
        Log.d("DATA INIT", "ACTION LOAD INIT SUCCESS");
    }

}
